

package jetbrains.buildServer.server.rest.errors;

import javax.ws.rs.core.Response;
import javax.ws.rs.ext.Provider;
import jetbrains.buildServer.server.rest.jersey.ExceptionMapperBase;
import org.jetbrains.annotations.NotNull;
import org.springframework.stereotype.Component;

/**
 * @author Yegor.Yarko
 * Date: 02.12.13
 */
@Provider
@Component
public class PartialUpdateErrorMapper extends ExceptionMapperBase<PartialUpdateError> {
  @Override
  public ResponseData getResponseData(@NotNull final PartialUpdateError e) {
    return new ResponseData(Response.Status.BAD_REQUEST,"There was an error processing the request, but the data could be updated partially. Please ensure consistent data state.");
  }
}